<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>
import mitts from '@/utils/mitt';
export default {
  name: 'App',
  beforeMount() {
    if (window) {
      window.setDate = this.setDates; // 设置日期
      window.getDeviceInfoCallBack = this.getDeviceInfoCallBacks;
      window.CloseWin = this.closeWins;
      window.OpenMsgWin = this.openMsgWins;
    }
  },
  methods: {
    // 设置日期
    setDates(week, time, date) {
      mitts.emit('setDates', {
        week,
        time,
        date
      });
    },
    // 获取设备信息回调
    getDeviceInfoCallBacks(obj) {
      mitts.emit('deviceInfoPing', obj);
    },
    // 获取设备信息回调
    openMsgWins(obj) {
      mitts.emit('openMsgWins', obj);
    },
    closeWins() {
      mitts.emit('closeWins');
    }
  }
};
</script>
<style scoped lang="scss">
html,
body,
#app {
  height: 100%;
  width: 100%;
  overflow: hidden;
}
</style>
